// _compoments/storyFromOtherView/storyFromOtherView.js
const app = getApp();
var mfApi = require('../../api/api.js');

Component({
    /**
     * 组件的属性列表
     */
    properties: {
        storyId: {
            type: String,
            value: ""
        },

        showNum: {
            type: Boolean,
            value: true
        }
    },

    /**
     * 组件的初始数据
     */
    data: {
        baseUrl: app.globalData.baseUrl,
        storyDetailData: {},
    },

    async attached() {
        setTimeout(async () => {
            let res = await mfApi.http(mfApi.getStoryById(this.data.storyId), "POST", {});
            if(res.code != 200) {
                wx.showToast({
                  title: '证书显示失败',
                  icon: "none"
                })
                return;
            }
            this.setData({
                storyDetailData: res.result
            })
        }, 0);

    },

    /**
     * 组件的方法列表
     */
    methods: {

    }
})